﻿using System;
using System.Collections.Generic;
using System.Linq;

using Recon.Portal.DataObjects;
using Recon.Portal.Data;

namespace Recon.Portal.Business
{
    public class CustomerEntity
    {
        #region: Public Constructor
        public CustomerEntity()
        {

        }
        #endregion

        #region: Public Methods
        public int Add(Customer cust, string userID)
        {
            DBFactory db = new DBFactory();
            return db.AddCustomer(cust, userID);
        }

        public int Modify(Customer cust, string userID)
        {
            DBFactory db = new DBFactory();
            return db.ModifyCustomer(cust, userID);
        }

        public List<Customer> GetCustomerDetailsByCustomerId(string CustomerID)
        {
            DBFactory db = new DBFactory();
            return db.GetCustomerDetailsByCustomerId(CustomerID);
        }

        public List<Customer> GetAllCustomers()
        {
            DBFactory db = new DBFactory();
            return db.GetAllCustomers();
        }
        public List<CustAccount> GetCustomerAccount(String CustomerID,String AccountID)
        {
            DBFactory db = new DBFactory();
            return db.GetCustomerAccount(CustomerID, AccountID);
        }
        public int AddCustAccount(CustAccount account)
        {
            DBFactory db = new DBFactory();
            return db.AddCusRemAccount(account);
        }

        public List<Customer> GetCustomer(string customerId)
        {
            DBFactory db = new DBFactory();
            return db.GetCustomer(customerId);
        }
        public List<Customer> GetUnauthorizedCustomers(string UserId)
        {
            DBFactory db = new DBFactory();
            return db.GetUnauthorizedCustomers(UserId);
        }

        public int AuthorizeCustomers(string userID, string custID)
        {
            return (new DBFactory()).AuthorizeCustomers(userID, custID);
        }

        public List<CustAccount> GetCustomerAccountRecords(String CustomerID)
        {
            DBFactory db = new DBFactory();
            return db.GetCustomerAccountRecords(CustomerID);
        }

        public int UpdateCustomerAccountRecords(CustAccount CustomerAccount)
        {
            DBFactory db = new DBFactory();
            return db.UpdateCustomerAccountRecords(CustomerAccount);
        }

        public int DeleteCustomerAccountRecords(String CustomerID, String AccountID)
        {
            DBFactory db = new DBFactory();
            return db.DeleteCustomerAccountRecords(CustomerID, AccountID);
        }

        public int DeleteCustomer(String CustomerID)
        {
            DBFactory db = new DBFactory();
            return db.DeleteCustomer(CustomerID);
        }
        #endregion
    }
}